<template>
  <div>
    <CompanyOne v-if="active === 0" @next="next" @setCodeForm="setCodeForm" />
    <CompanyTwo v-else-if="active === 1" :code-form="codeForm" @setPasswordForm="setPasswordForm" @next="next" @last="last" />
    <CompanyThree v-else :password-form="passwordForm" @last="last" />
  </div>
</template>
<script>
import CompanyOne from '@/views/welcome-register/component/CompanyOne'
import CompanyTwo from '@/views/welcome-register/component/CompanyTwo'
import CompanyThree from '@/views/welcome-register/component/CompanyThree'
export default {
  name: 'CompanyRegister',
  components: {
    CompanyOne,
    CompanyTwo,
    CompanyThree
  },
  data() {
    return {
      active: 0,
      codeForm: {},
      passwordForm: {}
    }
  },
  methods: {
    last() {
      if (this.active-- > 3) this.active = 0
    },
    next() {
      if (this.active++ > 2) this.active = 0
    },
    setCodeForm(codeForm) {
      this.codeForm = codeForm
    },
    setPasswordForm(passwordForm) {
      this.passwordForm = passwordForm
    }
  }
}
</script>
<style scoped lang="scss">
.registered {
  padding-top: 88px;
  padding-bottom: 87px;
  background: #f5f5f5;
  .type {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 14px 0 30px;
    .choose {
      display: flex;
      justify-content: space-between;
      .type-choose {
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 140px;
        height: 40px;
        background: rgba(255, 255, 255, 1);
        margin-right: 14px;
        border-bottom: 0;
      }
      .type-choose-1 {
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 140px;
        height: 40px;
        background: rgba(245, 245, 245, 1);
        border: 1px solid rgba(229, 229, 229, 1);
        border-bottom: 0;
        margin-right: 14px;
      }
    }
    .register{
      color: #0198CD;
      cursor: pointer;
    }
  }
  .registered-content {
    background: #ffffff;
    .contents {
      display: flex;
      justify-content: space-between;
      height: 600px;
      .left {
        padding-top: 71px;
        margin-left: 90px;
        .icon{
          position: absolute;
          left: 14px;
          font-size: 22px;
          top: 2px;
        }
        .business{
          width: 400px;
          height: 42px;
          background: #FF3B30;
          color: #ffffff;
          text-align: center;
          line-height: 42px;
          cursor: pointer;
          margin-left: 100px;
          border-radius: 3px;
          font-size: 18px;
        }
        .check{
          margin-top: 18px;
          margin-left: 100px;
          font-size: 12px;
          .clause{
            color: #FF3B30;
          }
        }
      }
      .right {
        .registered-img{
          padding: 114px 40px 0 0;
        }
      }
    }
  }
  /deep/ .registered-content{
    .el-input{
      width: 400px;
      height: 42px;
      .el-input__inner{
        height: 42px;
        padding-left: 47px;
      }
    }
  }
}
</style>
